<?php
/**
 * Created by PhpStorm.
 * User: gzy
 * Date: 2021/3/4
 * Time: 8:58
 */

$str = "ABCDEFG111111111111";
//** 不是用函数情况下 */
function way6($str)
{
    $o = '';
    $i = 0;
    while (isset($str[$i]) && $str[$i] != null) {
        $o = $str[$i++] . $o;
    }
    return $o;
}

echo way6($str);
